﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Add.aspx.cs" Inherits="socialnexus.admin.Users.Add"
MasterPageFile="~/masters/Admin.Master" %>

<asp:Content ContentPlaceHolderID="body" runat="server">

<h1>Add a User</h1>

<div class="formLineItem">
    <asp:Label ID="lblFirstName" runat="server" Text="First Name" 
        AssociatedControlID="txtFirstName" />
    <asp:TextBox ID="txtFirstName" runat="server" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtFirstName" runat="server"
        ErrorMessage="First Name is required." Display="Dynamic" />
</div>

<div class="formLineItem">
    <asp:Label ID="lblLastName" runat="server" Text="Last Name"
        AssociatedControlID="txtLastName" />
    <asp:TextBox ID="txtLastName" runat="server" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtFirstName" runat="server"
        ErrorMessage="Last Name is required." Display="Dynamic" />
</div>

<div class="formLineItem">
<asp:ScriptManager ID="smMain" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always" ChildrenAsTriggers="true">      
  <ContentTemplate>
    <asp:Label ID="Label1" AssociatedControlID="rblPictureType" runat="server" Text="Picture" />
    <asp:RadioButtonList runat="server" AutoPostBack="true" ID="rblPictureType"
        OnSelectedIndexChanged="rblPictureType_SelectedIndexChanged" RepeatDirection="Horizontal">
        <asp:ListItem Value="File" Text="File" />
        <asp:ListItem Value="URL" Text="URL" />
    </asp:RadioButtonList>

    <asp:Panel ID="tab1Content" runat="server" Visible="true" CssClass="formLineItem">
        <asp:Label ID="Label2" AssociatedControlID="fuPicture" Text="File Upload" runat="server" />
        <asp:FileUpload ID="fuPicture" runat="server" />
    </asp:Panel>

    <asp:Panel ID="tab2Content" runat="server" Visible="false" CssClass="formLineItem">
        <asp:Label ID="Label3" AssociatedControlID="txtPictureURL" Text="Picture URL" runat="server" />
        <asp:TextBox ID="txtPictureURL" runat="server" Width="300" />
    </asp:Panel>
  </ContentTemplate>
</asp:UpdatePanel>
</div>

<div class="formLineItem">
    <asp:Label ID="Label4" runat="server" Text="Username" 
        AssociatedControlID="txtUserName" />
    <asp:TextBox ID="txtUserName" runat="server" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="txtUserName" runat="server"
        ErrorMessage="The UserName is required." Display="Dynamic" />
    <asp:CustomValidator ID="CustomValidator1" ControlToValidate="txtUserName" runat="server" Display="Dynamic"
        OnServerValidate="ValidateUniqueUsername" ErrorMessage="That account already exists." />
</div>

<div class="formLineItem">
    <asp:Label ID="lblPassword" runat="server" Text="Password"
        AssociatedControlID="txtPassword" />
    <asp:TextBox TextMode="Password" ID="txtPassword" runat="server" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="txtPassword" runat="server"
        ErrorMessage="The password is required." Display="Dynamic" />
</div>

<div class="formLineItem">
    <asp:Label ID="lblPasswordConfirm" runat="server" Text="Password Confirmation"
        AssociatedControlID="txtPasswordConfirm" />
    <asp:TextBox TextMode="Password" ID="txtPasswordConfirm" runat="server" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ControlToValidate="txtPasswordConfirm" runat="server"
        ErrorMessage="The password confirmation is required." Display="Dynamic" />
    <asp:CustomValidator ID="CustomValidator2" ControlToValidate="txtPasswordConfirm" runat="server"
        OnServerValidate="ValidatePassword" Text="Passwords do not match." Display="Dynamic" />
</div>

<asp:Button runat="server" Text="Save Changes" ID="btnSave" OnClick="btnSave_Click" />
<asp:HyperLink ID="hlBack" Text="Cancel" runat="server" NavigateUrl="~/admin/Users/" />

</asp:Content>